import React, { Component } from 'react';
import style from "./dynamic.module.css"
import { RightOutlined } from '@ant-design/icons';
import axios from 'axios';

class dynamic extends Component {
    state={
        zixunlist:[]
    }
    componentDidMount(){
        const headerJSON = {
            "Content-Type": "application/json;charset=UTF-8"
        };
        axios({
            url:"/detailsDongtai/bdc/selectBDC",
            method:"post",
            header:headerJSON,
            data:{
                bid:this.props.id
            }
        }).then(res=>{
            this.setState({
                zixunlist:res.data,
            })
            console.log(res,"zixun")
        })
        // this.setState({})
    }
    render() {
        let id = this.props.id
        console.log(id,"idididididid")
        return (
            <div className={style.dynamic}>
                 <div className={style.dynamicTil}>
                    <span>楼盘动态</span>
                    <span className={style.all}>查看全部<RightOutlined style={{color:"#9a9a9a"}}/></span>
                </div>

                {this.state.zixunlist.map((item,i)=><div className={style.dynamicBox} key={i+1000}>
                    <span>{item.dtime}</span>
                    <p className={style.dynamicCon}>
                        {item.ddescribe}</p>
                </div>)}
                

                <div className={style.youhui}>
                    优惠动态变动提醒我
                </div>
            </div>
        );
    }
}

export default dynamic;